import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:videoplayer/utils/navigation_util.dart';

import '../intent/home_state.dart';

class HomeViewModel extends StateNotifier<HomeState> {
  HomeViewModel() : super(HomeState());

  ///初始化数据的方法
  void initData() {
    List<String> mList = ['房间列表', '收藏夹'];
    state = state.copyWith(functionList: mList);
  }

  ///跳转到下个页面
  void goNextPage(int index) {
    if (index == 0) {
      //跳转到房间列表页
      navigationUtil.goRoomListPage(state.functionList[index]);
    } else if (index == 1) {
      //跳转到收藏夹
    } else {}
  }
}
